﻿Public Sub ReplacePluginKeywords()
    MySearchReplace("using System.Workflow.Activities;", "using System.Activities;", True, False)
    MySearchReplace("using System.Workflow.ComponentModel;", "//using System.Workflow.ComponentModel;", True, False)
    MySearchReplace("SequenceActivity", "CodeActivity", True, False)
    MySearchReplace("ActivityExecutionContext", "CodeActivityContext", True, False)
    MySearchReplace("ActivityExecutionStatus", "void", True, False)
    'MySearchReplace("protected override ActivityExecutionStatus Execute", "protected override void Execute", True, False)
    MySearchReplace("IPluginExecutionContext", "IServiceProvider", True, False)
    MySearchReplace(".PreEntityImages.Properties", ".PreEntityImages", True, False)
    MySearchReplace(".PostEntityImages.Properties", ".PostEntityImages", True, False)
    MySearchReplace(".InputParameters.Properties", ".InputParameters", True, False)
    MySearchReplace("CrmOutput", "Output", True, False)
    MySearchReplace("CrmInput", "Input", True, False)
    MySearchReplace("CrmDefault", "Default", True, False)
    MySearchReplace("CrmReferenceTarget", "ReferenceTarget", True, False)
    MySearchReplace("CrmAttributeTarget", "AttributeTarget", True, False)
    MySearchReplace("[PersistOnClose]", "[Persist]", True, False)
    MySearchReplace("[ValidationOption(ValidationOption.Required)]", "[RequiredArgument]", True, False)
    MySearchReplace("PrimaryEntityImage", "/* CONVERSION ALERT */PrimaryEntityImage", True, False)

    ' RegEx queries
    MySearchReplace("\[CrmWorkflowActivity(\({.+}\))\]", "/*[CrmWorkflowActivity(\1)]*/", True, True)
    MySearchReplace("public static DependencyProperty({.+})\);", "/*public static DependencyProperty\1);*/", True, True)


    '
    ' Since custom workflow activities no longer return a value, we need to comment-out any return codes.
    ' It is unlikely that some of these codes would be encountered, but they are here regardless.
    '
    MySearchReplace("return ActivityExecutionStatus.Canceling;", "// return ActivityExecutionStatus.Canceling;", True, False)
    MySearchReplace("return ActivityExecutionStatus.Closed;", "// return ActivityExecutionStatus.Closed;", True, False)
    MySearchReplace("return ActivityExecutionStatus.Compensating;", "// return ActivityExecutionStatus.Compensating;", True, False)
    MySearchReplace("return ActivityExecutionStatus.Executing;", "// return ActivityExecutionStatus.Executing;", True, False)
    MySearchReplace("return ActivityExecutionStatus.Faulting;", "// return ActivityExecutionStatus.Faulting;", True, False)
    MySearchReplace("return ActivityExecutionStatus.Initialized;", "// return ActivityExecutionStatus.Initialized;", True, False)

    'MySearchReplace("", "", True, False)
    'MySearchReplace("", "", True, False)
    'MySearchReplace("", "", True, False)
    'MySearchReplace("", "", True, False)
    'MySearchReplace("", "", True, False)
End Sub